window.onload=function()
{ 
  var btn=document.getElementById("login");
  
  btn.onclick = function(){ 

	//登录账号取得
	var id = document.getElementsByName("username")[0].value;
	
	//登录密码取得
	var password = document.getElementsByName("password")[0].value;
	
	//教师学生checkBox
	var boxes = document.getElementById("stFlg");

	var stFlg = "";
	
	//判断是教师还是学生
	if (boxes.checked){
		stFlg = "teacher"
	}else{
		stFlg = "student"
	}

	//data
	var stryue = "id=" + id + "&password=" + password + "&stFlg=" + stFlg;	
	var url = WEB_URL_PREFIX + "/subscriber/login";
	$.ajax({
		url:url,
		data:stryue,
		type:"POST",
		dataType:"json",
		success:function(data){
			debugger;
		},
		error:function(data){
			debugger;
		}
		
	});

  }
}